package com.example.kiratest.realize.pojo;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务单状态:[1:active,2:pending,3:paused]
 *
 * @Author jyken
 * @Date 2024-12-06T15:06:08
 * @Copyright 1
 */

@AllArgsConstructor
@Getter
public enum TradeStatusEnum implements BaseEnum {
    ACTIVE(1,"active","激活"),
    PENDING(2,"pending","待启"),
    PAUSED(3,"paused","暂停")
    ;

    private final Integer value;

    private final String name;

    private final String desc;

    public static Integer getValueByName(String name) {
        for (TradeStatusEnum enumValue : TradeStatusEnum.values()) {
            if (enumValue.getName().equalsIgnoreCase(name)) {
                return enumValue.getValue();
            }
        }
        return null; // 或者抛出异常，具体根据需求
    }
}
